package com.biodiv.client.loadBalan;

import com.biodiv.client.loadBalan.strategy.LoadBalancerEnum;
import com.biodiv.common.instance.ServiceInstance;

/**
 * @Author: tianquan
 * @date: 2024-11-04  11:42
 * @Description: 负载均衡客户端
 */

public abstract class LoadBalancerClient {

    private LoadBalancerEnum balancerEnum;

    public LoadBalancerClient() {
        // 默认轮询
        balancerEnum = LoadBalancerEnum.RoundRobin;
    }

    public abstract ServiceInstance choose(String serviceName);

    public LoadBalancerClient(LoadBalancerEnum type) {
        balancerEnum = type;
    }

    public LoadBalancerEnum getBalancerEnum() {
        return balancerEnum;
    }

}
